package com.itheima.Controller;

import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.pojo.StudentOption;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    private ReportService reportService;
    /***
     * 班级人数统计
     * studentCountData
     */
    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        //调用Service获取统计数据
        StudentOption studentOption = reportService.getStudentCountData();
        return Result.success(studentOption);
    }

    /***
     * 学员学历统计
     * studentDegreeData
     */
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        //学员学历统计
        List<Map> list = reportService.getStudentDegreeData();
        return Result.success(list);
    }


    /**
     * 统计各个职位的员工人数
     */
    @GetMapping("/empJobData")
    public Result getEmpJobData(){

        JobOption jobOption = reportService.getEmpJobData();
        return Result.success(jobOption);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map> genderList= reportService.getEmpGenderData();
        return Result.success(genderList);


    }



}
